﻿namespace SERFLITEMAX20.Viewer
{
    using System;
    using System.Globalization;

    public class ListViewInt32Sort : ListViewTextSort
    {
        public ListViewInt32Sort(int sortColumn, bool ascending) : base(sortColumn, ascending)
        {
        }

        protected override int OnCompare(string lhs, string rhs)
        {
            try
            {
                return (int.Parse(lhs, NumberStyles.Number) - int.Parse(rhs, NumberStyles.Number));
            }
            catch
            {
                return 0;
            }
        }
    }
}

